package com.weaponlin.domain.generic;

import java.util.ArrayList;
import java.util.List;

public class ArrayAndGeneric {

    public static void main(String[] args) {
        Object[] array = new Long[2];
        array[0] = "this is string";
        System.out.println(array[0]);

        List<Object> list = new ArrayList<>();
        list.add("");

        List<Fruit> fruits = new ArrayList<>();
        fruits.add(new Apple());
    }
}

class Fruit {
}

class Apple extends Fruit {
}

class Jonathan extends Apple {
}

class Other extends Jonathan {
}

class Orange extends Fruit {
}